'\" t
.\"     Title: ccn_repo
.\"    Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\"      Date: 01/10/2014
.\"    Manual: \ \&
.\"    Source: \ \& 0.8.2
.\"  Language: English
.\"
.TH "CCN_REPO" "1" "01/10/2014" "\ \& 0\&.8\&.2" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ccn_repo \- utility to start, stop and signal Java application CCNx repositories\&.
.SH "SYNOPSIS"
.sp
\fBccn_repo\fR [\-memory \fImemory\fR] [\-debug \fIportno\fR] [\-output \fIoutput_file\fR] [\-debug\-daemon \fIportno\fR] [\-profile \fIprofile_info\fR] [\-suspend] [\-noshare] [\-debug\-flags \fIflags\fR] <repository_directory> [\-log \fIloglevel\fR] [\-policy <policy_file>] [\-global <global_prefix>] | interactive <respository_directory> | stop <pid> | stopall | signal <name> <pid>]
.SH "DESCRIPTION"
.sp
The \fBccn_repo\fR utility has been deprecated and will be phased out in favor of a new repository implementation, named ccnr, that offers better performance and an integrated synchronization facility\&. With the availability of sync, we anticipate that most nodes will be running a ccnr instance along with ccnd, to automatically share content in designated namespaces\&. In accord with this direction, the default scope of repository write requests is now local\&. Please consult the ccnr(1) man page for details\&.
.sp
The \fBccn_repo\fR utility starts, stops and signals CCNx Java content object repositories\&. This call requires a backend \fIrepository_directory\fR to store the content objects to the filesystem\&. Only one repository should run on a single \fIrepository_directory\fR at any time\&.
.sp
The utility has several modes \- it is normally started in the background, but can also be started in the foreground, allowing logging information to be seen on the console\&. It can also be signalled and stopped\&. The modes are as follows:
.PP
\fBccn_repo\fR <repository_directory>
.RS 4
This will start a content object repository in the specified directory\&. Once the repository is ready, a process id will be printed to the terminal\&. This pid is needed to signal this specific repository\&. The repository starts as a Daemon by default\&.
.RE
.PP
\fBccn_repo\fR interactive <repository_directory>
.RS 4
This will start the repository in the foreground so that logging information is output to the console\&.
.RE
.PP
\fBccn_repo\fR signal <name> <pid>
.RS 4
This command is generally used to cause the running repository to dump the names of its stored content objects to a file\&. The
\fIname\fR
option can be either
\fInametree\fR
or
\fInametreewide\fR\&.
\fInametree\fR
dumps the basic name tree while
\fInametreewide\fR
dumps the name tree with full name components (may be hard to read)\&. The
\fIpid\fR
is the process id displayed when the repository was started\&. The name tree file is written to the directory the repository was started with\&.
.RE
.PP
\fBccn_repo\fR signal <name> <pid>
.RS 4
This command is generally used to cause the running repository to dump the names of its stored content objects to a file\&. The
\fIname\fR
option can be either
\fInametree\fR
or
\fInametreewide\fR\&.
\fInametree\fR
dumps the basic name tree while
\fInametreewide\fR
dumps the name tree with full name components (may be hard to read)\&. The
\fIpid\fR
is the process id displayed when the repository was started\&. The name tree file is written to the directory the repository was started with\&.
.RE
.PP
\fBccn_repo\fR stop <pid>
.RS 4
This command stops a single repository with the supplied
\fIpid\fR\&.
.RE
.PP
\fBccn_repo\fR stopall
.RS 4
Stop all repositories running on a single machine (each needs a different
\fIrepository_directory\fR)\&.
.RE
.SH "OPTIONS"
.sp
The following options are available for all modes of \fBccn_repo\fR except interactive:
.PP
\fB\-memory\fR \fImemory\fR
.RS 4
This option adjusts the maximum amount of heap memory used by the repository\&. Units are bytes; optionally with a letter suffix (K, M, G, \&...)\&.
.RE
.PP
\fB\-debug\fR \fIportno\fR
.RS 4
Allows attachment of an eclipse remote debugger to the repo at the specified port number\&.
.RE
.PP
\fB\-output\fR \fIoutput_file\fR
.RS 4
Writes the output from the repository to a file\&. This has a side effect which causes ccn_repo to remain running in the foreground\&.
.RE
.PP
\fB\-debug\-daemon\fR \fIportno\fR
.RS 4
Allows for debugging a running repository through the supplied port\&.
.RE
.PP
\fB\-profile\fR \fIprofile_info\fR
.RS 4
Allows arbitrary system flags to the JVM for profiling or other uses\&.
.RE
.PP
\fB\-suspend\fR
.RS 4
Only useful in combination with
\fI\-debug\fR\&. Suspends the daemon at startup\&.
.RE
.PP
\fB\-noshare\fR
.RS 4
Used to turn off Java sharing\&. Needed for the vmvisual profiler\&.
.RE
.PP
\fB\-debug\-flags\fR \fIflags\fR
.RS 4
Used to set Java properties\&. For the repository, using
\fIREPO_EXITDUMP\fR
will cause the repository to write out its name tree on exit without requiring a dynamic signal\&.


.RE
.sp
The following options are available only when starting a repository\&. Note that these options must be specified on the command line after the specification of the <repository_directory>:
.PP
\fB\-log\fR \fILEVEL\fR
.RS 4
Set the logging level\&.
\fILEVEL\fR
must be the an acceptable Java Logger level: either an integer or a level name (e\&.g\&. SEVERE)\&.
.RE
.PP
\fB\-policy\fR \fIpolicy_file\fR
.RS 4
A policy file can most usefully be used to restrict the CCNx namespace(s) backed by this repo\&. It can also used to set the global prefix\&. A policy file is an XML file which must contain a <Policy> element containing the following elements:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
<PolicyVersion> (required) must be
1\&.5\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
<LocalName> (required) The eventual intent of this element is a value to be used as a "friendly name" for the repository\&. It is currently unused by the repository but must be present in the policy file\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
<GlobalPrefix> (required) The global prefix of the repo\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
<Namespace> The XML file may contain any number of <Namespace> elements which define the CCNx namespace backed by this repo\&. However in practice it is required that at least one of these elements define the key namespace which is by default
ccnx\&.org/Users\&.
.RE
.sp
Here\(cqs an example policy file which restricts the namespace backed by the repo to
/parc\&.com/Users/rasmussen
and
/parc\&.com/CCNx/documentation
as well as the key namespace:
.sp
.if n \{\
.RS 4
.\}
.nf
     <?xml version="1\&.0" encoding="UTF\-8"?>
     <Policy>
        <PolicyVersion> 1\&.5 </PolicyVersion>
        <LocalName> /ParcRepositories/TestRepository </LocalName>
        <GlobalPrefix> parc\&.com/csl/ccn/repositories/TestRepository </GlobalPrefix>
        <Namespace> /parc\&.com/Users/rasmussen </Namespace>
        <Namespace> /parc\&.com/CCNx/documentation </Namespace>
        <Namespace> /ccnx\&.org/Users </Namespace>
     </Policy>
.fi
.if n \{\
.RE
.\}
.sp
Note that once the
\fB\-policy\fR
option has been used to start a repository, the specified policy becomes that repository\(cqs permanent policy\&. If the repository is restarted, the
\fB\-policy\fR
option does not need to be reissued to retain the same policy\&. To change the policy, the repository must be restarted using the
\fB\-policy\fR
option specifying a policy file with a different policy\&.
.RE
.PP
\fB\-global\fR \fIglobal_prefix\fR
.RS 4
Sets the global name prefix for the repository (NOT the content it stores)\&. The prefix must be globally unique\&.
.RE
.SH "EXIT STATUS"
.PP
\fB0\fR
.RS 4
Success
.RE
.PP
\fB1\fR
.RS 4
Failure (syntax or usage error; startup error; failed to have
\fBccnd\fR
running)
.RE
.SH "AUTHOR"
.sp
Paul Rasmussen Rebecca Braynard Jim Thornton
